//
//  CarNewsTableViewCell.m
//  YouWen
//
//  Created by Lee GJ on 15-3-9.
//  Copyright (c) 2015年 刘永和. All rights reserved.
//

#import "CarNewsTableViewCell.h"

@implementation CarNewsTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatSubviews];
    }
    return self;
}

- (void)creatSubviews
{
    NSLog(@"创建自定义cell" );
    
    self.contentView.backgroundColor = [NightModeHandle shareNightModeHandle].allViewColor;
    
    
    
    
    
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(135, 10, 220, 60)];
    self.titleLabel.backgroundColor = [NightModeHandle shareNightModeHandle].allViewColor;
    self.titleLabel.textColor = [UIColor blackColor];
    self.titleLabel.numberOfLines = 0;
    //字体大小
    self.titleLabel.font = [UIFont systemFontOfSize:[WordSizeHandle shareWordSizeHandle].lineTitleSize];
    [self.contentView addSubview:self.titleLabel];
    
    self.cateGoryLabel = [[UILabel alloc]initWithFrame:CGRectMake(280, 70, 80, 20)];
    self.cateGoryLabel.backgroundColor = [NightModeHandle shareNightModeHandle].allViewColor;
    self.cateGoryLabel.font = [UIFont systemFontOfSize:[WordSizeHandle shareWordSizeHandle].lineOtherSize];
    self.cateGoryLabel.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.cateGoryLabel];
    
    self.carImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 8, 120, 84)];
    self.carImageView.backgroundColor = [NightModeHandle shareNightModeHandle].allViewColor;
    self.carImageView.image = self.carImage;
    //图片自使用宽高比例
    self.carImageView.contentMode = UIViewContentModeScaleAspectFit;
    [self.contentView addSubview:self.carImageView];
    
    UIImage *categoryImage = [UIImage imageNamed:@"6.0baitian_pinglun@2x.png"];
    UIImageView *categoryImageView = [[UIImageView alloc]initWithFrame:CGRectMake(190, 74, 15, 15)];
    categoryImageView.image = categoryImage;
    categoryImageView.backgroundColor = [NightModeHandle shareNightModeHandle].allViewColor;
    
    [self.contentView addSubview:categoryImageView];
    
    self.commentLabel = [[UILabel alloc]initWithFrame:CGRectMake(210, 74, 50, 15)];
    self.commentLabel.backgroundColor = [NightModeHandle shareNightModeHandle].allViewColor;
    self.commentLabel.textColor = [UIColor grayColor];
    self.commentLabel.font = [UIFont systemFontOfSize:[WordSizeHandle shareWordSizeHandle].lineOtherSize];
    [self.contentView addSubview:self.commentLabel];
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
